/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
 */

package pl.droidsonroids.gif;

import ohos.agp.graphics.Surface;
import ohos.agp.graphics.SurfaceOps;
import ohos.agp.render.Canvas;

class PlaceholderDrawingSurfaceTextureListener implements SurfaceOps.Callback {
	//	TODO
	//	private final GifTextureView.PlaceholderDrawListener mDrawer;
	//  TODO
	/*public PlaceholderDrawingSurfaceTextureListener(GifTextureView.PlaceholderDrawListener drawer) {
		mDrawer = drawer;
	}*/

	/*@Override
	public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) {
		final Surface surface = new Surface(surfaceTexture);
		final Canvas canvas = surface.lockCanvas(null);
		mDrawer.onDrawPlaceholder(canvas);
		surface.unlockCanvasAndPost(canvas);
		surface.release();
	}*/

	@Override
	public void surfaceCreated(SurfaceOps surfaceOps) {
		final Surface surface = surfaceOps.getSurface();
		final Canvas canvas = surfaceOps.lockCanvas();
//		TODO
//		mDrawer.onDrawPlaceholder(canvas);
		surfaceOps.unlockCanvasAndPost(canvas);
//		surface.release();
	}

	@Override
	public void surfaceChanged(SurfaceOps surfaceOps, int i, int i1, int i2) {
	}

	@Override
	public void surfaceDestroyed(SurfaceOps surfaceOps) {
	}
}
